<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>收货地址</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no,minimal-ui,viewport-fit=cover"/>
    <meta name="keywords" content="收货地址">
    <meta name="description" content="收货地址">
    <script type="text/javascript" src="js/base.js" charset="UTF-8"></script>
    <!-- <link rel="stylesheet" type="text/css" href="css/theme-chalk/index.css"> -->
    <!-- <link rel="stylesheet" type="text/css" href="css/swiper-bundle.min.css"> -->
    <link rel="stylesheet" type="text/css" href="css/base.css">
    <link rel="stylesheet" type="text/css" href="css/style.css">
    <script type='text/javascript' src="js/jquery.min.js" charset="UTF-8"></script>
    <!-- <script type='text/javascript' src="js/html2canvas.min.js" charset="UTF-8"></script> -->
    <script type="text/javascript" src="js/layer/layer.js" charset="UTF-8"></script>
    <script type="text/javascript" src="js/vue.js" charset="UTF-8"></script>
    <script type="text/javascript" src="js/axios.min.js" charset="UTF-8"></script>
    <!-- <script type='text/javascript' src="js/elementui.min.js" charset="UTF-8"></script> -->
    <!-- <script type='text/javascript' src="js/swiper-bundle.min.js" charset="UTF-8"></script> -->
    <script type='text/javascript' src="../common/js/helper.js" charset="UTF-8"></script>
</head>
<body>
<div class="wrapperbox addresspage hasmenu" id="app" v-if="loaded==true">
    <div class="content">
      <!-- 地址数据为空时 -->
      <!-- <div class="emptybox">
        <div class="empty">
          <img src="images/address-empty.png">
          <p>您还没有收货地址，快快添加一个吧</p>
        </div>
      </div> -->

      <div class="item">
        <div class="text" @click="choosethis">
          <p>山东省菏泽市成武县</p>
          <h3>凤凰国际东区10号楼1002室</h3>
          <p><span>刘小波</span>13910436282</p>
        </div>
        <div class="btnbox">
            <a href="./editaddress.html?type=edit&id=1" class="btn"><span>编辑地址</span></a>
            <div class="btn" @click="opendelpop"><span>删除地址</span></div>
        </div>
      </div>
      <div class="item">
        <div class="text" @click="choosethis">
          <p>山东省菏泽市成武县</p>
          <h3>凤凰国际东区10号楼1002室</h3>
          <p><span>刘小波</span>13910436282</p>
        </div>
        <div class="btnbox">
            <a href="./editaddress.html?type=edit&id=1" class="btn"><span>编辑地址</span></a>
            <div class="btn" @click="opendelpop"><span>删除地址</span></div>
        </div>
      </div>

    </div>

    <div class="bottom">
        <a href="./addaddress.html" class="btn ico"><span>新建收货地址</span></a>
    </div>

    <div class="delpop pop">
        <div class="shadow"></div>
        <div class="wrap">
            <div class="text">
                <p>确认删除此地址</p>
            </div>
            <div class="btnbox">
                <div class="btn" @click="goDelete">确认</div>
                <div class="btn" @click="closedelpop">取消</div>
            </div>
        </div>
    </div>
</div>
</body>
<script>
  new Vue({
    el: '#app',
    data() {
      return {
        datalist:[],
        loaded: false,
      }
    },
    mounted() {
      
      var that = this;
      that.getdata();
    },
    methods: {
      getdata: function () {
        var that = this;
        // 查询地址列表
        // common_get('product_recommend?product_id=' + that.pid).then(res => {
          that.datalist = [];
          that.loaded=true;
        // })
      },
      opendelpop: function () {
        var that = this;
        $('.pop.delpop').fadeIn(500);
      },
      closedelpop: function () {
        var that = this;
        $('.pop.delpop').fadeOut(500);
      },
      goDelete: function () {
        var that = this;
        $('.pop.delpop').fadeIn(500);
      },
      choosethis: function () {
        var that = this;
        layer.msg('选择成功');
        setTimeout(()=>{
          layer.closeAll();
        },2000)
        setTimeout(()=>{
          // 设置当前为选择地址之后返回并刷新上一页
          window.history.back();
        },2500)
      },
    }
  });
</script>
</html>